/**
 * Created by Administrator on 15-11-19.
 */
var Filter = RichBase.extend({
	statics : {

	},
	EVENTS : {
		"click" : {
			".mluSelectBox .lt" : "onMluSelectClick"
		}
	},
	init : function(){
		var that = this;
		this.container = $("#filterWrap");
		this.timeSelectBox = $("#time_select_box");
		this.timeSelectPop = $("#timeSelectPop");
		this.nameSelectBox = $("#name_select_box");
		this.nameSelectPop = $("#nameSelectPop");
		$(document).on("click",function(){
			that.timeSelectPop.hide();
			that.nameSelectPop.hide();
		})
	},
	posSelect : function(){
		var offset,top,left,height,width;
		var timeSelectBox = this.timeSelectBox;
		var timeSelectPop = this.timeSelectPop;
		var nameSelectBox = this.nameSelectBox;
		var nameSelectPop = this.nameSelectPop;
		offset = timeSelectBox.offset();
		console.log(timeSelectBox);
		console.log(offset);
		top = offset.top;
		left = offset.left;
		height = timeSelectBox.height();
		width = timeSelectBox.width();
		timeSelectPop.css({
			top : top+height,
			left : left,
			width : width
		})
		offset = nameSelectBox.offset();
		top = offset.top;
		left = offset.left;
		height = nameSelectBox.height();
		width = nameSelectBox.width();
		nameSelectPop.css({
			top : top+height,
			left : left,
			width : width
		})
	},
	onMluSelectClick : function(that,e){
		e.stopPropagation();
		var tarBox = $(e.currentTarget);
		if(tarBox.hasClass("time")){
			that.timeSelectPop.show();
			that.nameSelectPop.hide();
		}else{
			that.nameSelectPop.show();
			that.timeSelectPop.hide();
		}
	}
});
module.exports = Filter;